% ECG_HIST       Histogram for ECG detection and analysis
%
% Input parameters: Real-time heartrate
% Output parameters: graph of real-time heartrate histogram
%
% See also: hist
% Copyright: Group 8
% Modified at 20th Oct 2010
%-------------------------------------------------------------------------
function ecg_hist(HR_real)
%% Finding maximum, minimum and standard deviation of History of ECG signal
[max_HR,min_HR,sd_ecg,HR_modified] = ecg_history(HR_real);

 %% Histogram
% divide every 10/min interval into N intervals
N = 15;
Number_of_intervals = floor(N / 10 * (max_HR-min_HR));
hist(HR_modified,Number_of_intervals);
title('Heart rate deviation'),xlabel('Heart rate / min^{-1}'),ylabel('Count');
    